<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {

    Route::group([], function () {
        Route::controller('auth', 'AuthController');
        Route::controller('common', 'CommonController');
        Route::controller('warn','WarnController');
        Route::controller('data','DataController');

    });

    Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => ['admin.auth']], function () {
        //
        Route::get('/', 'IndexController@admin');
        Route::controller('index', 'IndexController');
        Route::controller('user', 'UserController');
        Route::controller('site', 'SiteController');
        Route::controller('group', 'GroupController');
        Route::controller('device', 'DeviceController');
    });

    Route::group(['prefix' => 'frontend', 'namespace' => 'Frontend', 'middleware' => ['admin.auth']], function () {
        //
        Route::get('/', 'IndexController@base');
        Route::controller('index', 'IndexController');
        Route::controller('site', 'SiteController');
        Route::controller('user', 'UserController');
        Route::controller('device', 'DeviceController');
        Route::controller('warn', 'WarnController');
        Route::controller('weather','WeatherController');
    });

    Route::get('/', 'HomeController@index');

});

Route::group(['prefix'=>'bank','namespace'=>'Bank'], function () {
    Route::post('bank-auth','BankController@postBankForAuth');
    Route::get('/site-list','BankController@getSiteList');
    Route::post('/month-gen-value','BankController@getMonthGenOfSid');
    Route::post('/year-gen-value','BankController@getYearGenOfSid');

});

Route::get('/get-today-list','TestController@getDataList');
Route::get('/get-to-sum','TestController@getCountYearData');
Route::get('/get-exports-lists','TestController@getExportList');
Route::get('/get-export-data','TestController@getExportData');
Route::get('/set-record-data','TestController@setRecordData');
Route::get('/set-record-data-mysql','TestController@setRecordDataByMysql');
Route::get('/get-test-for-cron','TestController@getTestForCron');
Route::get('/get-result-json','TestController@getResultJson');
Route::get('/get-publish','TestController@getPublish');
Route::get('/get-reday','TestController@getReday');
Route::get('/get-del','TestController@getDelAll');
Route::post('/set-add-offset','TestController@postDataOffset');
Route::post('/get-year-data','TestController@getRecordYearData');

